package com.alibaba.controller;

import com.alibaba.bean.Dormitory;
import com.alibaba.service.DormitoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/dormitory")
public class DormitoryController {
    @Autowired
    private DormitoryService dormitoryService;

    @GetMapping(value = "/findAll")
    public List<Dormitory> findAll(){
        return dormitoryService.findAllDomitory();
    }

}